package azcat.planner.materials;

import java.text.DecimalFormat;

public class Material implements java.io.Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2199125896871916778L;
	private String materialType;
	private int materialAvailable; // this represents how much material is available for this type
	//these are the measures for the blocks of materials 
	private float width;
	private float length;
	private float depth;	
	private float density;
	private String usedUnits;// This stores the units of measurements depending on material type
	private String partNumber;
	private String componentName;
	private String size;
	
	public String getSize() {
		return size;
	}
	public void setSize(String size) {
		this.size = size;
	}
	public String getComponentName() {
		return componentName;
	}
	public void setComponentName(String componentName) {
		this.componentName = componentName;
	}
	private float amountNeeded;//represents the amount of blocks needed for a specific type of material.
	
	private float piecesxBlock;
	private int totalComps;

	
	public Material(String type, float depth, float width, float length, float density, String units, int available){
		this.materialType = type;
		this.depth = depth;
		this.width = width;
		this.length = length;
		this.density = density;
		this.usedUnits = units;
		this.materialAvailable = available;
	}
	public String getPartNumber() {
		return partNumber;
	}

	public void setPartNumber(String partNumber) {
		this.partNumber = partNumber;
	}
	
	public int getTotalComps() {
		return totalComps;
	}

	public void setTotalComps(int totalComps) {
		this.totalComps = totalComps;
	}

	
	public float getPiecesxBlock() {
		return piecesxBlock;
	}

	public void setPiecesxBlock(float piecesxBlock) {
		DecimalFormat df = new DecimalFormat("#.##");
		String temp =df.format(piecesxBlock);
		this.piecesxBlock = Float.parseFloat(temp);
	}
	
	public float getDepth() {
		return depth;
	}
	public void setDepth(float depth) {
		this.depth = depth;
	}
	
	public String getMaterialType() {
		return materialType;
	}
	public void setMaterialType(String materialType) {
		this.materialType = materialType;
	}
	public int getMaterialAvailable() {
		return materialAvailable;
	}
	public void setMaterialAvailable(int materialAvailable) {
		this.materialAvailable = materialAvailable;
	}
	public float getWidth() {
		return width;
	}
	public void setWidth(float width) {
		this.width = width;
	}
	public float getLength() {
		return length;
	}
	public void setLength(float lnegth) {
		this.length = lnegth;
	}
	public float getDensity() {
		return density;
	}
	public void setDensity(float depth) {		
		this.density = depth;
	}
	public float getAmountNeeded() {
		return amountNeeded;
	}
	public void setAmountNeeded(float amountNeeded) {
		DecimalFormat df = new DecimalFormat("#.##");
		String temp =df.format(amountNeeded);		
		this.amountNeeded = Float.parseFloat(temp);
	}

}
